﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CVsharp.Jquery.Tree;

namespace CVsharp.JqueryUIMvc.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            Tree tree = new Tree();
            Node root = new Node();
            root.Propertys.Add("name", "rootNode");
            root.Propertys.Add("id", "1");
            root.DPropertys.fdfdgfdgfd = "ddddddddddddd";
            Node root2 = new Node();
            root2.Propertys.Add("name", "rootNode");
            root2.Propertys.Add("id", "2");
            root.Nodes.Add(root2);
            tree.RootNodes.Add(root);
            tree.RootNodes.Add(root2);
            Console.WriteLine(tree.ToJsonString("Name", "children"));
            ViewBag.TreeJsonStr = tree.ToJsonString();
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your quintessential app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your quintessential contact page.";

            return View();
        }
    }
}
